#include "Net.h"
#include "PandroidSettings.h"


	Net::Net(){
	_motor = new MotorWrapper(NET_MOTOR_CHANNEL, MotorWrapper::position, false);
	_topSensor = new DigitalInput(NET_LIMIT_OPEN);
	_bottomSensor = new DigitalInput(NET_LIMIT_CLOSE); 
	}

	Net::~Net(){
		
	}
	
	void Net::Open(){
		if (_topSensor->Get() < DIGITAL_INPUT_THRESHOLD){
			_motor->SetSetpoint(90);
		}
		else{
			_motor->SetSetpoint(0);
		}
	}
	
	void Net::Close(){
		if (_bottomSensor->Get() > DIGITAL_INPUT_THRESHOLD){
				_motor->SetSetpoint(0);
			}
			else{
				_motor->SetSetpoint(90);
			}
	}
	
	bool Net::IsOpen(){
		if (_topSensor->Get() > DIGITAL_INPUT_THRESHOLD) return true;
			return false;
	}
	
	bool Net::IsClose(){
		if (_bottomSensor->Get() > DIGITAL_INPUT_THRESHOLD) return true;
			return false;
	}

